<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //一,自定义一个类(用构造函数的方式定义的类)
        //1.构造函数和普通函数的区别
        //1)函数名首字母大写
        //2)构造函数的调用用new运算符
        function Person(name ,sex){
            this.name=name
            this.sex =sex
        }
        let p1 =new Person("sb",'nan')
        console.log(p1);
    </script>
</body>
</html>